﻿<controls:ChildWindow x:Class="AR.Views.Candidat.CSVCandidatView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
HasCloseButton="True"      
xmlns:ViewModels="clr-namespace:AR.ViewModels"
xmlns:Controls="clr-namespace:AR.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"  
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  
xmlns:viewmodel ="clr-namespace:AR.ViewModels"             
Width="1000" Height="464.537" 
Title="Liste des Candidats">
    
   
    <Grid Width="Auto" Background="{StaticResource AtosBlue}">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="45"/>
        </Grid.RowDefinitions>
        <!--DataContext="viewModel">-->
        
        <sdk:DataGrid  x:Name="CandidatGrid" Width="Auto"  Height="Auto" ItemsSource="{Binding ListCandidatsCsv,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                	AutoGenerateColumns ="False" ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="0">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn Header="N° de ligne" Binding="{Binding NumeroLigne}" />
                <sdk:DataGridTextColumn Header="Source" Binding="{Binding Source}" />
                <sdk:DataGridTextColumn Header="Nom" Binding="{Binding Nom}" />
                <sdk:DataGridTextColumn Header="Prénom" Binding="{Binding Prenom}" />
                <sdk:DataGridTemplateColumn  Header="Niveau études">
                    <sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <ComboBox Height="Auto" 
                                ItemsSource="{Binding
                       RelativeSource={RelativeSource AncestorType=sdk:DataGrid},
                       Path=DataContext.NiveauxEtudes, Mode=TwoWay}"    DisplayMemberPath="INTITULE" SelectedValuePath="ID_ETUDE" 
                                     SelectedValue="{Binding IdEtudes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=true, NotifyOnValidationError=true}" Width="Auto">
                            </ComboBox>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellEditingTemplate>
                </sdk:DataGridTemplateColumn >
                <sdk:DataGridTemplateColumn  Header="Niveau expérience">
                    <!--<sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding }" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>-->
                    <sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <ComboBox Height="Auto" 
                                ItemsSource="{Binding
                       RelativeSource={RelativeSource AncestorType=sdk:DataGrid},
                       Path=DataContext.NiveauxExperience, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"    DisplayMemberPath="INTITULE" SelectedValuePath="ID_EXPERIENCE" 
                       SelectedValue="{Binding IdExp, Mode=TwoWay,ValidatesOnDataErrors=true, NotifyOnValidationError=true}" Width="Auto">
                               
                            </ComboBox>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellEditingTemplate>
                </sdk:DataGridTemplateColumn >
                <sdk:DataGridTextColumn Header="Salaire Actuel" Binding="{Binding Salaire_Actuelle}" />
                <sdk:DataGridTextColumn Header="Salaire souhaité" Binding="{Binding Salaire_Demande}" />
                <sdk:DataGridTextColumn Header="Préavis" Binding="{Binding Preavis}" />
                <sdk:DataGridTextColumn Header="Email" Binding="{Binding Email,Mode=TwoWay,ValidatesOnDataErrors=true, NotifyOnValidationError=true,ValidatesOnNotifyDataErrors=True,ValidatesOnExceptions=True,UpdateSourceTrigger=PropertyChanged}" />
                <sdk:DataGridTextColumn Header="Téléphone" Binding="{Binding Tel}" />
                <sdk:DataGridTextColumn Header="Date Test Technique" Binding="{Binding DateTestTechnique}" />

            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
        <Button Grid.Row="1" Command="{Binding SaveAndValiateCommmand}" Content="Valider et enregister" VerticalAlignment="Center"/>
    </Grid>

</controls:ChildWindow>